// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   JobtypeTreeCardData.java

package nc.ui.bd.b36;

import nc.bs.framework.common.NCLocator;
import nc.bs.logging.Logger;
import nc.bs.uap.bd.BDRuntimeException;
import nc.itf.uap.bd.job.IJobtypePrivate;
import nc.ui.trade.pub.IVOTreeDataByID;
import nc.vo.pub.BusinessException;
import nc.vo.pub.SuperVO;

public class JobtypeTreeCardData
	implements IVOTreeDataByID
{

	String m_pk_corp;
	private SuperVO m_vos[];

	public JobtypeTreeCardData(String pk_corp)
	{
		m_pk_corp = null;
		m_vos = null;
		m_pk_corp = pk_corp;
	}

	public String getIDFieldName()
	{
		return "pk_jobtype";
	}

	public String getParentIDFieldName()
	{
		return "pk_parent";
	}

	public String getShowFieldName()
	{
		return "jobtypecode";
	}

	public SuperVO[] getTreeVO()
	{
		if (m_vos == null || m_vos.length == 0)
		{
			IJobtypePrivate iJobtypePrivate = (IJobtypePrivate)NCLocator.getInstance().lookup(nc.itf.uap.bd.job.IJobtypePrivate.class);
			try
			{
				m_vos = iJobtypePrivate.queryAllJobtypeVOs(m_pk_corp, new Boolean(true));
			}
			catch (BusinessException e)
			{
				Logger.error(e.getMessage(), e);
				throw new BDRuntimeException(e.getMessage());
			}
		}
		return m_vos;
	}
}
